home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual BASIC 5.0 (Ent. Edition) / Vb5ent Extractor.EXE / VB / SAMPLES / PGUIDE / CONTROLS / WORDWRAP.FRM (.txt) < prev   
Encoding:
Visual Basic Form  |  1996-09-16  |  5.8 KB  |  181 lines

  1. VERSION 5.00
  2. Begin VB.Form frmWordWrap 
  3.    Caption         =   "WordWrap and Autosize"
  4.    ClientHeight    =   4320
  5.    ClientLeft      =   1110
  6.    ClientTop       =   1665
  7.    ClientWidth     =   5760
  8.    BeginProperty Font 
  9.       Name            =   "MS Sans Serif"
  10.       Size            =   8.25
  11.       Charset         =   0
  12.       Weight          =   700
  13.       Underline       =   0   'False
  14.       Italic          =   0   'False
  15.       Strikethrough   =   0   'False
  16.    EndProperty
  17.    Height          =   4725
  18.    Left            =   1050
  19.    LinkTopic       =   "Form1"
  20.    ScaleHeight     =   4320
  21.    ScaleWidth      =   5760
  22.    Top             =   1320
  23.    Width           =   5880
  24.    Begin VB.CommandButton cmdCycle 
  25.       Caption         =   "C&ycle"
  26.       BeginProperty Font 
  27.          Name            =   "MS Sans Serif"
  28.          Size            =   8.25
  29.          Charset         =   0
  30.          Weight          =   400
  31.          Underline       =   0   'False
  32.          Italic          =   0   'False
  33.          Strikethrough   =   0   'False
  34.       EndProperty
  35.       Height          =   495
  36.       Left            =   480
  37.       TabIndex        =   2
  38.       Top             =   2520
  39.       Width           =   1215
  40.    End
  41.    Begin VB.CheckBox chkAutoSize 
  42.       Caption         =   "&AutoSize"
  43.       BeginProperty Font 
  44.          Name            =   "MS Sans Serif"
  45.          Size            =   8.25
  46.          Charset         =   0
  47.          Weight          =   400
  48.          Underline       =   0   'False
  49.          Italic          =   0   'False
  50.          Strikethrough   =   0   'False
  51.       EndProperty
  52.       Height          =   495
  53.       Left            =   3840
  54.       TabIndex        =   0
  55.       Top             =   1080
  56.       Width           =   1215
  57.    End
  58.    Begin VB.CheckBox chkWordWrap 
  59.       Caption         =   "&WordWrap"
  60.       BeginProperty Font 
  61.          Name            =   "MS Sans Serif"
  62.          Size            =   8.25
  63.          Charset         =   0
  64.          Weight          =   400
  65.          Underline       =   0   'False
  66.          Italic          =   0   'False
  67.          Strikethrough   =   0   'False
  68.       EndProperty
  69.       Height          =   495
  70.       Left            =   3840
  71.       TabIndex        =   1
  72.       Top             =   1680
  73.       Width           =   1575
  74.    End
  75.    Begin VB.CommandButton cmdClose 
  76.       Cancel          =   -1  'True
  77.       Caption         =   "&Close"
  78.       BeginProperty Font 
  79.          Name            =   "MS Sans Serif"
  80.          Size            =   8.25
  81.          Charset         =   0
  82.          Weight          =   400
  83.          Underline       =   0   'False
  84.          Italic          =   0   'False
  85.          Strikethrough   =   0   'False
  86.       EndProperty
  87.       Height          =   495
  88.       Left            =   3840
  89.       TabIndex        =   3
  90.       Top             =   2520
  91.       Width           =   1215
  92.    End
  93.    Begin VB.Label lblHelp 
  94.       BackColor       =   &H00C0C0C0&
  95.       Caption         =   "Check the AutoSize or WordWrap buttons to see their effect on the label."
  96.       BeginProperty Font 
  97.          Name            =   "MS Sans Serif"
  98.          Size            =   8.25
  99.          Charset         =   0
  100.          Weight          =   400
  101.          Underline       =   0   'False
  102.          Italic          =   0   'False
  103.          Strikethrough   =   0   'False
  104.       EndProperty
  105.       Height          =   615
  106.       Left            =   480
  107.       TabIndex        =   5
  108.       Top             =   3360
  109.       Width           =   2775
  110.    End
  111.    Begin VB.Label lblDisplay 
  112.       BorderStyle     =   1  'Fixed Single
  113.       Caption         =   "A demonstration of the AutoSize and WordWrap properties."
  114.       Height          =   255
  115.       Left            =   480
  116.       TabIndex        =   4
  117.       Top             =   480
  118.       Width           =   1815
  119.    End
  120. Attribute VB_Name = "frmWordWrap"
  121. Attribute VB_Base = "0{1D936791-C9EF-11CF-84BA-00AA00C007F0}"
  122. Attribute VB_Creatable = False
  123. Attribute VB_TemplateDerived = False
  124. Attribute VB_PredeclaredId = True
  125. Attribute VB_Exposed = False
  126. Attribute VB_Customizable = False
  127. Sub Display()
  128.     ' this subroutine changes the display
  129.     ' characteristics of the label control
  130.     ' Reset the example.
  131.     lblDisplay.AutoSize = False
  132.     lblDisplay.WordWrap = False
  133.     lblDisplay.Width = 1695
  134.     lblDisplay.Height = 225
  135.     ' Check for WordWrap and Autosize.
  136.     If chkWordWrap.Value = 1 Then
  137.         lblDisplay.WordWrap = True
  138.     End If
  139.     If chkAutoSize.Value = 1 Then
  140.         lblDisplay.AutoSize = True
  141.     End If
  142. End Sub
  143. Private Sub chkAutoSize_Click()
  144.     ' call the Display subroutine
  145.     Call Display
  146. End Sub
  147. Private Sub chkWordWrap_Click()
  148.     ' call the Display subroutine
  149.     Call Display
  150. End Sub
  151. Private Sub cmdClose_Click()
  152.    Unload Me    ' Unload this form.
  153. End Sub
  154. Private Sub cmdCycle_Click()
  155.     ' cycle through the four possible combinations
  156.     ' neither check box is selected
  157.     If chkAutoSize.Value = 0 And _
  158.      chkWordWrap.Value = 0 Then
  159.         ' select the AutoSize check box
  160.         chkAutoSize.Value = 1
  161.     ' both check boxes are selected
  162.     ElseIf chkAutoSize.Value = 1 And _
  163.      chkWordWrap.Value = 1 Then
  164.         ' deselect the AutoSize check box and
  165.         ' select the WordWrap check box
  166.         chkAutoSize.Value = 0
  167.         chkWordWrap.Value = 1
  168.     ' only the WordWrap check box is selected
  169.     ElseIf chkAutoSize.Value = 0 And _
  170.      chkWordWrap.Value = 1 Then
  171.         ' deselect both check boxes
  172.         chkAutoSize.Value = 0
  173.         chkWordWrap.Value = 0
  174.     ' only the AutoSize check box is selected
  175.     Else
  176.         ' select the WordWrap check box - the
  177.         ' AutoSize check box is already selected
  178.         chkWordWrap.Value = 1
  179.     End If
  180. End Sub
  181.